<!doctype html>
<html lang="zh" xmlns:th="https://www.thymeleaf.org">
<head>
    <th:block th:include="include-front-custom :: head('5180it.com','欢迎进入')"/>

	<style type="text/css">
		.paBanner{ position:fixed;}
		.prevBanner,.nextBanner{ cursor:pointer; width:8%; height:100%; _height:100%; top:0;}
		.prevBanner{ left:0; background:url(/img/arrow_l.png) no-repeat center 44%;}
		.prevBanner:hover{background:#efefef url(/img/arrow_l.png) no-repeat center 44%;}
		.nextBanner{ right:0;background:url(/img/arrow_r.png) no-repeat center 44%;}
		.nextBanner:hover{background:#efefef url(/img/arrow_r.png) no-repeat center 44%;}
	</style>
	
    <!-- 遮罩层 -->
    <script th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>

    <script th:src="@{/ajax/libs/layer/layer.min.js}"></script>
   <!-- <script th:src="@{/ajax/libs/layui/layui.js}"></script>-->
    <script th:src="@{/dimple/js/common.js}"></script>
    <script th:src="@{/dimple/js/ui.js}"></script>
</head>

<body class="nobg">
<th:block th:replace="include-front-custom :: header"/>

<!--内容区开始-->
<div class="container">
    <!--最新文章-->
    <section style="width: 100%;">
        <article>
            <h4 class="index-title">
                <a th:if="${curUser==null}" class="orange-text"  href="/bbs/front/toLogin?toPage=kaoshi">登录可进行更多操作</a>
                <span  class="orange-text"  th:if="${curUser!=null}">
            	已登录
            </span>
            </h4>
            <!--  <div style="text-align: center;">
                 <input name="questionSearch" type="text" class="text" id="questionSearch" value="" maxlength="100"
                     placeholder="请输入要查询的问题" style="width:60%;">
                 <input type="button" id="searchQuestionBtn" class="btn btn-inverse" value="查询  "/>
             </div> -->

            <!--分页开始-->
            <!-- <div th:replace="navigation :: navigation-direct(${folderList})"></div> -->
            <!--分页结束-->
            <div class="arclist" style="margin-left: 20px;margin-right: 20px;padding-right: 20px;">
                <!--列表开始-->
                <form>
                    <div th:each="folderObj:${folderList.list}">
                        <div class="arc-left">
                            <h4 class="blue-text" style="margin-right: 30px;">
                            	<!-- 选择题 -->
                                <a th:if="${folderObj.type} eq 'choice'" th:text="${folderObj.folderName}" th:href="${'/kaoshi/questionFolder/'+funcId+'/'+folderObj.id+'.html'}"></a>
                                <!-- pdf阅读 -->
                                <a th:if="${folderObj.type} eq 'pdf'" th:text="${folderObj.folderName}" th:href="${'/kaoshi/pdfFolder/'+funcId+'/'+folderObj.id+'.html'}"></a>
                            </h4>
                        </div>
                    </div>
                </form>
                <!--列表结束-->
            </div>
            <!--分页开始-->
            <div th:replace="navigation :: navigation-param(${folderList},'funcId='+${funcId})"></div>
            <!--分页结束-->
        </article>
    </section>

    <a href="javascript:void(0);" class="prevBanner paBanner none" id="banner_prev"></a>
    <a href="javascript:void(0);" class="nextBanner paBanner" id="banner_next"></a>

    <!--左侧结束-->
    <!--<th:block th:replace="include-front-custom :: side"/>-->
</div>
<!--<th:block th:replace="include-front-custom :: footer"/>-->

<script>
	$(function(){
		$('#banner_next').bind('click',function(){
			$('.paginationNext')[0].click();
		});
		$('#banner_prev').click(function(){
			$('.paginationPrev')[0].click();
		});
		$("#searchQuestionBtn").click(function(){
			console.info($("#questionSearch").val());
		});
		
	});

	//收藏
   function addFavorites(questionId){
	   $.ajax({
           type: "POST",
           url: "/kaoshi/addFavorites",
           data: {"questionId": questionId},
           dataType: "json",
           success: function (data) {
        	   console.info(data);
        	   if(data.hasFavorites==1){//已收藏的
        		   $("#addQues"+questionId).hide();
        		   $("#delQues"+questionId).show();
        	   }else{
        		   $("#addQues"+questionId).show();
        		   $("#delQues"+questionId).hide();
        	   }
        	   if (data.code == 200) {
                   layer.msg(data.msg, {icon: 1});
               } else {
                   layer.msg(data.msg, {icon: 2});
               }
           },
           error: function (jqXHR) {
        	   layer.msg('发送错误：' + jqXHR.status);
           },
       });
   }
	
   function delFavorites(questionId){
	   $.ajax({
           type: "POST",
           url: "/kaoshi/delFavorites",
           data: {"questionId": questionId},
           dataType: "json",
           success: function (data) {
        	   console.info(data);
        	   if(data.hasFavorites==1){//已收藏的
        		   $("#addQues"+questionId).hide();
        		   $("#delQues"+questionId).show();
        	   }else{
        		   $("#addQues"+questionId).show();
        		   $("#delQues"+questionId).hide();
        	   }
        	   if (data.code == 200) {
                   layer.msg(data.msg, {icon: 1});
               } else {
                   layer.msg(data.msg, {icon: 2});
               }
           },
           error: function (jqXHR) {
        	   layer.msg('发送错误：' + jqXHR.status);
           },
       });
   }
   
</script>
</body>
</html>